void start_game()
{
    int n, ch, t = 0, x = 0, y = FACE_Y / 2 - 2, i, j;
    int space_c = 0;//旋转次数
    draw_kong(nn, space_c, 4, FACE_Y + 3);
    n = nn;
    nn = rand() % 7;    //随机一个数，除以7取余，赋值给nn 
    color(nn);
    draw_dia(nn, space_c, 4, FACE_Y + 3);
    while (1)
    {
        color(n);
        draw_dia(n, space_c, x, y);//画出图形
        if (t == 0)
            t = 15000;
        while (--t)
        {
            if (_kbhit() != 0)//有输入就跳出
                break;
        }
        if (t == 0)
        {
            if (pd(n, space_c, x + 1, y) == 1)
            {
                draw_kong(n, space_c, x, y);
                x++;            //向下降落
            }
            else
            {
                for (i = 0; i < 4; i++)
                {
                    for (j = 0; j < 4; j++)
                    {
                        if (dia[n][space_c].space[i][j] == 1)
                        {
                            face.data[x + i][y + j] = Box;
                            face.color[x + i][y + j] = n;
                            while (xc());
                        }
                    }
                }
                return;
            }
        }
        else
        {
            ch = _getch();
            switch (ch)     //移动
            {
            case LEFT: if (pd(n, space_c, x, y - 1) == 1)   //判断是否可以移动
            {
                draw_kong(n, space_c, x, y);
                y--;
            }
                     break;
            case RIGHT: if (pd(n, space_c, x, y + 1) == 1)
            {
                draw_kong(n, space_c, x, y);
                y++;
            }
                      break;
            case DOWN: if (pd(n, space_c, x + 1, y) == 1)
            {
                draw_kong(n, space_c, x, y);
                x++;
            }
                     break;
            case UP: if (pd(n, (space_c + 1) % 4, x + 1, y) == 1)
            {
                draw_kong(n, space_c, x, y);
                space_c = (space_c + 1) % 4;
            }
                      break;
            case ESC: system("cls");
                gotoxy(FACE_X / 2, FACE_Y);
                printf("---游戏结束!---\n\n");
                gotoxy(FACE_X / 2 + 2, FACE_Y);
                printf("---按任意键退出!---\n");
                _getch();
                exit(0);
                break;
            case  'R':
            case  'r':  main();
                exit(0);
            case  SPACE:  while (1)
            {
                if (_kbhit() != 0)//有输入就跳出
                    break;
            }
                     break;
            }
        }
    }
}